<template>
  <div class="item-box">
    <div :style="{height: `${source.height}px`}" />
    <div class="item-text">{{ index }} - {{ source.name }}</div>
  </div>
</template>

<script>
export default {
  name: 'ItemComponent',
  props: {
    index: { // 每一行的索引
      type: Number,
      default: 0
    },
    source: { // 每一行的内容
      type: Object,
      default() {
        return {}
      }
    }
  }
}
</script>
<style lang="less">
.item-box {
  background-color: red;
  margin-bottom: 10px;
}
.item-text {
  height: 20px;
  line-height: 20px;
}
</style>
